/*
 * @Descripttion: 
 * @version: 
 * @Author: Indolphin
 * @Date: 2021-03-12 22:08:28
 * @LastEditors: Indolphin
 * @LastEditTime: 2021-03-14 02:46:34
 */
import * as types from '../interface';
import { dataRequest, loginRequest } from './request';

/**
 * 用户登录
 * 
 * @param username 用户名
 * @param password 密码
 * @param rememberme 记住我
 */
export const login = ({ username, password, rememberme }: types.User) => {
    return loginRequest({
        url: '/api/auth/oauth/token',
        data: {
            username,
            password,
            rememberme
        },
        method: "POST"
    });
}

/**
 * 用户注销
 * @param {string} url
 * @return {*}
 */
export const logout = () => {
    return dataRequest({ 
        url: '/api/auth/oauth/delete' 
    });
}

/**
 * 查询用户菜单
 */
export const queryMenuList = () => {
    return dataRequest({
        url: '/api/auth/menu/query',
        data: {},
        method: 'GET'
    })
}